package com.jishuo.pzk.service;

import com.google.gson.Gson;
import com.jishuo.base.config.PzkConfig;
import com.jishuo.pzk.bean.base.VouFieldVO;
import com.jishuo.pzk.bean.base.VoucherDetailVO;
import com.jishuo.pzk.bean.base.VoucherVO;
import com.jishuo.pzk.bean.bill.SpecialVO;
import com.jishuo.pzk.util.IdWorker;
import com.jishuo.pzk.util.ImageUtils;
import com.jishuo.pzk.util.VoucherUtil;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.awt.*;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * 分成
 */
@Service
public class SpecialService {

    private static final char[] ChineseNum = {'零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖'};
    private static final String vocde = PzkConfig.Vocode_Special;
    private static final int busitype = PzkConfig.Pztype_Special;//凭证类型

    @Resource
    private VoucherService voucherService;

    @Resource
    private VoucherUtil voucherUtil;

    /**
     * 存储凭证数据
     *
     * @param data 报文
     * @return
     */
    public int savePzk(String data) {
        SpecialVO special = new Gson().fromJson(data, SpecialVO.class);
        VoucherVO voucher = voucherUtil.getVoucher(busitype, "0", vocde, special.getBillNum(), "0", "2", special.getCantonId(), special.getPayerBankId(), "0", special.getBankStation(), special.getPayBankDt(), new Gson().toJson(special));
        return voucherService.saveVoucher(voucher);
    }

    /**
     * 获得凭证字段明细
     *
     * @param list 字段定义
     * @param voucher   凭证对象
     * @return 凭证细表
     */
    public static List<VoucherDetailVO> getDetail(List<VouFieldVO> list, VoucherVO voucher) {
        String VO_SN = voucher.getVoSn();
        String ORDERBILLSN = voucher.getOrderbillsn();
        SpecialVO special = new Gson().fromJson(voucher.getVoucher(), SpecialVO.class);
        List<VoucherDetailVO> listDe = new ArrayList<>();
        String dhmillion = "";
        String dtmillion = "";
        String dmillion = "";
        String dhthousand = "";
        String dtthousand = "";
        String dthousand = "";
        String dhundred = "";
        String dten = "";
        String dyuan = "";
        String djiao = "";
        String dfen = "";

        String hmillion = "";
        String bhmillion = "";
        String tmillion = "";
        String btmillion = "";
        String million = "";
        String bmillion = "";
        String hthousand = "";
        String bhthousand = "";
        String tthousand = "";
        String btthousand = "";
        String thousand = "";
        String bthousand = "";
        String hundred = "";
        String bhundred = "";
        String ten = "";
        String bten = "";
        String yuan = "";
        String byuan = "";
        String jiao = "";
        String bjiao = "";
        String fen = "";
        String bfen = "";


        BigDecimal b = new BigDecimal(special.getMoney());
        b = b.multiply(new BigDecimal(100));
        String detaimy = b.toString().split("\\.")[0];

        int length = detaimy.length();
        if (length == 11) {
            dhmillion = detaimy.charAt(0) + "";
            dtmillion = detaimy.charAt(1) + "";
            dmillion = detaimy.charAt(2) + "";
            dhthousand = detaimy.charAt(3) + "";
            dtthousand = detaimy.charAt(4) + "";
            dthousand = detaimy.charAt(5) + "";
            dhundred = detaimy.charAt(6) + "";
            dten = detaimy.charAt(7) + "";
            dyuan = detaimy.charAt(8) + "";
            djiao = detaimy.charAt(9) + "";
            dfen = detaimy.charAt(10) + "";

            hmillion = detaimy.charAt(0) + "";
            bhmillion = ChineseNum[Integer.parseInt(hmillion)] + "";

            tmillion = detaimy.charAt(1) + "";
            btmillion = ChineseNum[Integer.parseInt(tmillion)] + "";

            million = detaimy.charAt(2) + "";
            bmillion = ChineseNum[Integer.parseInt(million)] + "";

            hthousand = detaimy.charAt(3) + "";
            bhthousand = ChineseNum[Integer.parseInt(hthousand)] + "";

            tthousand = detaimy.charAt(4) + "";
            btthousand = ChineseNum[Integer.parseInt(tthousand)] + "";

            thousand = detaimy.charAt(5) + "";
            bthousand = ChineseNum[Integer.parseInt(thousand)] + "";

            hundred = detaimy.charAt(6) + "";
            bhundred = ChineseNum[Integer.parseInt(hundred)] + "";

            ten = detaimy.charAt(7) + "";
            bten = ChineseNum[Integer.parseInt(ten)] + "";

            yuan = detaimy.charAt(8) + "";
            byuan = ChineseNum[Integer.parseInt(yuan)] + "";

            jiao = detaimy.charAt(9) + "";
            bjiao = ChineseNum[Integer.parseInt(jiao)] + "";

            fen = detaimy.charAt(10) + "";
            bfen = ChineseNum[Integer.parseInt(fen)] + "";
        }
        if (length == 10) {
            dtmillion = detaimy.charAt(0) + "";
            dmillion = detaimy.charAt(1) + "";
            dhthousand = detaimy.charAt(2) + "";
            dtthousand = detaimy.charAt(3) + "";
            dthousand = detaimy.charAt(4) + "";
            dhundred = detaimy.charAt(5) + "";
            dten = detaimy.charAt(6) + "";
            dyuan = detaimy.charAt(7) + "";
            djiao = detaimy.charAt(8) + "";
            dfen = detaimy.charAt(9) + "";

            tmillion = detaimy.charAt(0) + "";
            btmillion = ChineseNum[Integer.parseInt(tmillion)] + "";

            million = detaimy.charAt(1) + "";
            bmillion = ChineseNum[Integer.parseInt(million)] + "";

            hthousand = detaimy.charAt(2) + "";
            bhthousand = ChineseNum[Integer.parseInt(hthousand)] + "";

            tthousand = detaimy.charAt(3) + "";
            btthousand = ChineseNum[Integer.parseInt(tthousand)] + "";

            thousand = detaimy.charAt(4) + "";
            bthousand = ChineseNum[Integer.parseInt(thousand)] + "";

            hundred = detaimy.charAt(5) + "";
            bhundred = ChineseNum[Integer.parseInt(hundred)] + "";

            ten = detaimy.charAt(6) + "";
            bten = ChineseNum[Integer.parseInt(ten)] + "";

            yuan = detaimy.charAt(7) + "";
            byuan = ChineseNum[Integer.parseInt(yuan)] + "";

            jiao = detaimy.charAt(8) + "";
            bjiao = ChineseNum[Integer.parseInt(jiao)] + "";

            fen = detaimy.charAt(9) + "";
            bfen = ChineseNum[Integer.parseInt(fen)] + "";
        }
        if (length == 9) {

            dmillion = detaimy.charAt(0) + "";
            dhthousand = detaimy.charAt(1) + "";
            dtthousand = detaimy.charAt(2) + "";
            dthousand = detaimy.charAt(3) + "";
            dhundred = detaimy.charAt(4) + "";
            dten = detaimy.charAt(5) + "";
            dyuan = detaimy.charAt(6) + "";
            djiao = detaimy.charAt(7) + "";
            dfen = detaimy.charAt(8) + "";

            million = detaimy.charAt(0) + "";
            bmillion = ChineseNum[Integer.parseInt(million)] + "";

            hthousand = detaimy.charAt(1) + "";
            bhthousand = ChineseNum[Integer.parseInt(hthousand)] + "";

            tthousand = detaimy.charAt(2) + "";
            btthousand = ChineseNum[Integer.parseInt(tthousand)] + "";

            thousand = detaimy.charAt(3) + "";
            bthousand = ChineseNum[Integer.parseInt(thousand)] + "";

            hundred = detaimy.charAt(4) + "";
            bhundred = ChineseNum[Integer.parseInt(hundred)] + "";

            ten = detaimy.charAt(5) + "";
            bten = ChineseNum[Integer.parseInt(ten)] + "";

            yuan = detaimy.charAt(6) + "";
            byuan = ChineseNum[Integer.parseInt(yuan)] + "";

            jiao = detaimy.charAt(7) + "";
            bjiao = ChineseNum[Integer.parseInt(jiao)] + "";

            fen = detaimy.charAt(8) + "";
            bfen = ChineseNum[Integer.parseInt(fen)] + "";
        }
        if (length == 8) {

            dhthousand = detaimy.charAt(0) + "";
            dtthousand = detaimy.charAt(1) + "";
            dthousand = detaimy.charAt(2) + "";
            dhundred = detaimy.charAt(3) + "";
            dten = detaimy.charAt(4) + "";
            dyuan = detaimy.charAt(5) + "";
            djiao = detaimy.charAt(6) + "";
            dfen = detaimy.charAt(7) + "";


            hthousand = detaimy.charAt(0) + "";
            bhthousand = ChineseNum[Integer.parseInt(hthousand)] + "";

            tthousand = detaimy.charAt(1) + "";
            btthousand = ChineseNum[Integer.parseInt(tthousand)] + "";

            thousand = detaimy.charAt(2) + "";
            bthousand = ChineseNum[Integer.parseInt(thousand)] + "";

            hundred = detaimy.charAt(3) + "";
            bhundred = ChineseNum[Integer.parseInt(hundred)] + "";

            ten = detaimy.charAt(4) + "";
            bten = ChineseNum[Integer.parseInt(ten)] + "";

            yuan = detaimy.charAt(5) + "";
            byuan = ChineseNum[Integer.parseInt(yuan)] + "";

            jiao = detaimy.charAt(6) + "";
            bjiao = ChineseNum[Integer.parseInt(jiao)] + "";

            fen = detaimy.charAt(7) + "";
            bfen = ChineseNum[Integer.parseInt(fen)] + "";
        }
        if (length == 7) {
            dtthousand = detaimy.charAt(0) + "";
            dthousand = detaimy.charAt(1) + "";
            dhundred = detaimy.charAt(2) + "";
            dten = detaimy.charAt(3) + "";
            dyuan = detaimy.charAt(4) + "";
            djiao = detaimy.charAt(5) + "";
            dfen = detaimy.charAt(6) + "";

            tthousand = detaimy.charAt(0) + "";
            btthousand = ChineseNum[Integer.parseInt(tthousand)] + "";

            thousand = detaimy.charAt(1) + "";
            bthousand = ChineseNum[Integer.parseInt(thousand)] + "";

            hundred = detaimy.charAt(2) + "";
            bhundred = ChineseNum[Integer.parseInt(hundred)] + "";

            ten = detaimy.charAt(3) + "";
            bten = ChineseNum[Integer.parseInt(ten)] + "";

            yuan = detaimy.charAt(4) + "";
            byuan = ChineseNum[Integer.parseInt(yuan)] + "";

            jiao = detaimy.charAt(5) + "";
            bjiao = ChineseNum[Integer.parseInt(jiao)] + "";

            fen = detaimy.charAt(6) + "";
            bfen = ChineseNum[Integer.parseInt(fen)] + "";
        }
        if (length == 6) {
            dthousand = detaimy.charAt(0) + "";
            dhundred = detaimy.charAt(1) + "";
            dten = detaimy.charAt(2) + "";
            dyuan = detaimy.charAt(3) + "";
            djiao = detaimy.charAt(4) + "";
            dfen = detaimy.charAt(5) + "";

            thousand = detaimy.charAt(0) + "";
            bthousand = ChineseNum[Integer.parseInt(thousand)] + "";

            hundred = detaimy.charAt(1) + "";
            bhundred = ChineseNum[Integer.parseInt(hundred)] + "";

            ten = detaimy.charAt(2) + "";
            bten = ChineseNum[Integer.parseInt(ten)] + "";

            yuan = detaimy.charAt(3) + "";
            byuan = ChineseNum[Integer.parseInt(yuan)] + "";

            jiao = detaimy.charAt(4) + "";
            bjiao = ChineseNum[Integer.parseInt(jiao)] + "";

            fen = detaimy.charAt(5) + "";
            bfen = ChineseNum[Integer.parseInt(fen)] + "";
        }
        if (length == 5) {
            dhundred = detaimy.charAt(0) + "";
            dten = detaimy.charAt(1) + "";
            dyuan = detaimy.charAt(2) + "";
            djiao = detaimy.charAt(3) + "";
            dfen = detaimy.charAt(4) + "";

            hundred = detaimy.charAt(0) + "";
            bhundred = ChineseNum[Integer.parseInt(hundred)] + "";

            ten = detaimy.charAt(1) + "";
            bten = ChineseNum[Integer.parseInt(ten)] + "";

            yuan = detaimy.charAt(2) + "";
            byuan = ChineseNum[Integer.parseInt(yuan)] + "";

            jiao = detaimy.charAt(3) + "";
            bjiao = ChineseNum[Integer.parseInt(jiao)] + "";

            fen = detaimy.charAt(4) + "";
            bfen = ChineseNum[Integer.parseInt(fen)] + "";
        }
        if (length == 4) {
            dten = detaimy.charAt(0) + "";
            dyuan = detaimy.charAt(1) + "";
            djiao = detaimy.charAt(2) + "";
            dfen = detaimy.charAt(3) + "";

            ten = detaimy.charAt(0) + "";
            bten = ChineseNum[Integer.parseInt(ten)] + "";

            yuan = detaimy.charAt(1) + "";
            byuan = ChineseNum[Integer.parseInt(yuan)] + "";

            jiao = detaimy.charAt(2) + "";
            bjiao = ChineseNum[Integer.parseInt(jiao)] + "";

            fen = detaimy.charAt(3) + "";
            bfen = ChineseNum[Integer.parseInt(fen)] + "";
        }
        if (length == 3) {
            dyuan = detaimy.charAt(0) + "";
            djiao = detaimy.charAt(1) + "";
            dfen = detaimy.charAt(2) + "";


            yuan = detaimy.charAt(0) + "";
            byuan = ChineseNum[Integer.parseInt(yuan)] + "";

            jiao = detaimy.charAt(1) + "";
            bjiao = ChineseNum[Integer.parseInt(jiao)] + "";

            fen = detaimy.charAt(2) + "";
            bfen = ChineseNum[Integer.parseInt(fen)] + "";
        }
        if (length == 2) {

            djiao = detaimy.charAt(0) + "";
            dfen = detaimy.charAt(1) + "";

            jiao = detaimy.charAt(0) + "";
            bjiao = ChineseNum[Integer.parseInt(jiao)] + "";

            fen = detaimy.charAt(1) + "";
            bfen = ChineseNum[Integer.parseInt(fen)] + "";
        }
        if (length == 1) {

            dfen = detaimy.charAt(0) + "";

            fen = detaimy.charAt(0) + "";
            bfen = ChineseNum[Integer.parseInt(fen)] + "";

        }

        for (VouFieldVO vouFieldVO : list) {
            int x;
            int y;
            int x1;
            String pos = "";
            String pos1 = "";

            if ("left".equals(vouFieldVO.getHalign()) || vouFieldVO.getHalign() == null) {
                pos = vouFieldVO.getFieldPosLeft();

            } else if ("right".equals(vouFieldVO.getHalign())) {
                pos = vouFieldVO.getFieldPosRight();

            } else if ("center".equals(vouFieldVO.getHalign())) {
                pos = vouFieldVO.getFieldPosLeft();
                pos1 = vouFieldVO.getFieldPosRight();
            }
            if (vouFieldVO.getField() != null) {
                if (vouFieldVO.getField().trim().equals("bfen")) {
                    if (!bfen.equals("") && !bfen.equals("-1")) {

                        VoucherDetailVO voucherDetailVO = new VoucherDetailVO();
                        voucherDetailVO.setVoVdSn(IdWorker.getOrderCode(busitype));
                        voucherDetailVO.setVoDeSn(VO_SN);
                        voucherDetailVO.setOrderbillsn(ORDERBILLSN);

                        Color color = Color.BLACK;
                        String cc = ImageUtils.Color2String(color);
                        x = Integer.parseInt(pos.split(",")[0]);
                        y = Integer.parseInt(pos.split(",")[1]);
                        x1 = Integer.parseInt(pos1.split(",")[0]);

                        voucherDetailVO.setAlpha(1);
                        voucherDetailVO.setFontcolor(cc);
                        voucherDetailVO.setFontname("宋体");

                        voucherDetailVO.setFontsize(40);
                        voucherDetailVO.setHalign(vouFieldVO.getHalign());
                        voucherDetailVO.setX(x);
                        voucherDetailVO.setY(y);
                        voucherDetailVO.setXx(x1);
                        voucherDetailVO.setYy(y);
                        voucherDetailVO.setField("bfen");
                        voucherDetailVO.setFieldType("String");
                        voucherDetailVO.setFieldValue(bfen);
                        voucherDetailVO.setMaxlength(vouFieldVO.getMaxlength());
                        voucherDetailVO.setIsnewline(vouFieldVO.getIsnewline());
                        listDe.add(voucherDetailVO);
                    }
                }
                if (vouFieldVO.getField().trim().equals("bhmillion")) {
                    if (!bhmillion.equals("") && !bhmillion.equals("-1")) {
                        VoucherDetailVO voucherDetailVO = new VoucherDetailVO();
                        voucherDetailVO.setVoVdSn(IdWorker.getOrderCode(busitype));
                        voucherDetailVO.setVoDeSn(VO_SN);
                        voucherDetailVO.setOrderbillsn(ORDERBILLSN);

                        Color color = Color.BLACK;
                        String cc = ImageUtils.Color2String(color);
                        x = Integer.parseInt(pos.split(",")[0]);
                        y = Integer.parseInt(pos.split(",")[1]);

                        voucherDetailVO.setAlpha(1);
                        voucherDetailVO.setFontcolor(cc);
                        voucherDetailVO.setFontname("宋体");

                        voucherDetailVO.setFontsize(40);
                        voucherDetailVO.setHalign(vouFieldVO.getHalign());
                        voucherDetailVO.setX(x);
                        voucherDetailVO.setY(y);
                        voucherDetailVO.setField("bhmillion");
                        voucherDetailVO.setFieldType("String");
                        voucherDetailVO.setFieldValue(bhmillion);
                        voucherDetailVO.setMaxlength(vouFieldVO.getMaxlength());
                        voucherDetailVO.setIsnewline(vouFieldVO.getIsnewline());
                        listDe.add(voucherDetailVO);


                    }
                }
                if (vouFieldVO.getField().trim().equals("bhthousand")) {
                    if (!bhthousand.equals("") && !bhthousand.equals("-1")) {
                        VoucherDetailVO voucherDetailVO = new VoucherDetailVO();
                        voucherDetailVO.setVoVdSn(IdWorker.getOrderCode(busitype));
                        voucherDetailVO.setVoDeSn(VO_SN);
                        voucherDetailVO.setOrderbillsn(ORDERBILLSN);

                        Color color = Color.BLACK;
                        String cc = ImageUtils.Color2String(color);
                        x = Integer.parseInt(pos.split(",")[0]);
                        y = Integer.parseInt(pos.split(",")[1]);
                        x1 = Integer.parseInt(pos1.split(",")[0]);

                        voucherDetailVO.setAlpha(1);
                        voucherDetailVO.setFontcolor(cc);
                        voucherDetailVO.setFontname("宋体");

                        voucherDetailVO.setFontsize(40);
                        voucherDetailVO.setHalign(vouFieldVO.getHalign());
                        voucherDetailVO.setX(x);
                        voucherDetailVO.setY(y);
                        voucherDetailVO.setXx(x1);
                        voucherDetailVO.setYy(y);
                        voucherDetailVO.setField("bhthousand");
                        voucherDetailVO.setFieldType("String");
                        voucherDetailVO.setFieldValue(bhthousand);
                        voucherDetailVO.setMaxlength(vouFieldVO.getMaxlength());
                        voucherDetailVO.setIsnewline(vouFieldVO.getIsnewline());
                        listDe.add(voucherDetailVO);
                    }
                }
                if (vouFieldVO.getField().trim().equals("bhundred")) {
                    if (!bhundred.equals("") && !bhundred.equals("-1")) {
                        VoucherDetailVO voucherDetailVO = new VoucherDetailVO();
                        voucherDetailVO.setVoVdSn(IdWorker.getOrderCode(busitype));
                        voucherDetailVO.setVoDeSn(VO_SN);
                        voucherDetailVO.setOrderbillsn(ORDERBILLSN);

                        Color color = Color.BLACK;
                        String cc = ImageUtils.Color2String(color);
                        x = Integer.parseInt(pos.split(",")[0]);
                        y = Integer.parseInt(pos.split(",")[1]);
                        x1 = Integer.parseInt(pos1.split(",")[0]);

                        voucherDetailVO.setAlpha(1);
                        voucherDetailVO.setFontcolor(cc);
                        voucherDetailVO.setFontname("宋体");

                        voucherDetailVO.setFontsize(40);
                        voucherDetailVO.setHalign(vouFieldVO.getHalign());
                        voucherDetailVO.setX(x);
                        voucherDetailVO.setY(y);
                        voucherDetailVO.setXx(x1);
                        voucherDetailVO.setYy(y);
                        voucherDetailVO.setField("bhundred");
                        voucherDetailVO.setFieldType("String");
                        voucherDetailVO.setFieldValue(bhundred);
                        voucherDetailVO.setMaxlength(vouFieldVO.getMaxlength());
                        voucherDetailVO.setIsnewline(vouFieldVO.getIsnewline());
                        listDe.add(voucherDetailVO);
                    }
                }
                if (vouFieldVO.getField().trim().equals("billnum")) {
                    VoucherDetailVO voucherDetailVO = new VoucherDetailVO();
                    voucherDetailVO.setVoVdSn(IdWorker.getOrderCode(busitype));
                    voucherDetailVO.setVoDeSn(VO_SN);
                    voucherDetailVO.setOrderbillsn(ORDERBILLSN);

                    Color color = Color.BLACK;
                    String cc = ImageUtils.Color2String(color);
                    x = Integer.parseInt(pos.split(",")[0]);
                    y = Integer.parseInt(pos.split(",")[1]);

                    voucherDetailVO.setAlpha(1);
                    voucherDetailVO.setFontcolor(cc);
                    voucherDetailVO.setFontname("宋体");

                    voucherDetailVO.setFontsize(40);
                    voucherDetailVO.setHalign(vouFieldVO.getHalign());
                    voucherDetailVO.setX(x);
                    voucherDetailVO.setY(y);
                    voucherDetailVO.setField("billnum");
                    voucherDetailVO.setFieldType("String");
                    voucherDetailVO.setFieldValue(special.getBillNum());
                    voucherDetailVO.setMaxlength(vouFieldVO.getMaxlength());
                    voucherDetailVO.setIsnewline(vouFieldVO.getIsnewline());
                    listDe.add(voucherDetailVO);
                }
                if (vouFieldVO.getField().trim().equals("bjiao")) {
                    if (!bjiao.equals("") && !bjiao.equals("-1")) {
                        x = Integer.parseInt(pos.split(",")[0]);
                        y = Integer.parseInt(pos.split(",")[1]);
                        x1 = Integer.parseInt(pos1.split(",")[0]);

                        VoucherDetailVO voucherDetailVO = new VoucherDetailVO();
                        voucherDetailVO.setVoVdSn(IdWorker.getOrderCode(busitype));
                        voucherDetailVO.setVoDeSn(VO_SN);
                        voucherDetailVO.setOrderbillsn(ORDERBILLSN);

                        Color color = Color.BLACK;
                        String cc = ImageUtils.Color2String(color);

                        voucherDetailVO.setAlpha(1);
                        voucherDetailVO.setFontcolor(cc);
                        voucherDetailVO.setFontname("宋体");

                        voucherDetailVO.setFontsize(40);
                        voucherDetailVO.setHalign(vouFieldVO.getHalign());
                        voucherDetailVO.setX(x);
                        voucherDetailVO.setY(y);
                        voucherDetailVO.setXx(x1);
                        voucherDetailVO.setYy(y);
                        voucherDetailVO.setField("bjiao");
                        voucherDetailVO.setFieldType("String");
                        voucherDetailVO.setFieldValue(bjiao);
                        voucherDetailVO.setMaxlength(vouFieldVO.getMaxlength());
                        voucherDetailVO.setIsnewline(vouFieldVO.getIsnewline());
                        listDe.add(voucherDetailVO);
                    }
                }
                if (vouFieldVO.getField().trim().equals("bmillion")) {
                    if (!bmillion.equals("") && !bmillion.equals("-1")) {
                        x = Integer.parseInt(pos.split(",")[0]);
                        y = Integer.parseInt(pos.split(",")[1]);
                        x1 = Integer.parseInt(pos1.split(",")[0]);
                        VoucherDetailVO voucherDetailVO = new VoucherDetailVO();
                        voucherDetailVO.setVoVdSn(IdWorker.getOrderCode(busitype));
                        voucherDetailVO.setVoDeSn(VO_SN);
                        voucherDetailVO.setOrderbillsn(ORDERBILLSN);

                        Color color = Color.BLACK;
                        String cc = ImageUtils.Color2String(color);

                        voucherDetailVO.setAlpha(1);
                        voucherDetailVO.setFontcolor(cc);
                        voucherDetailVO.setFontname("宋体");

                        voucherDetailVO.setFontsize(40);
                        voucherDetailVO.setHalign(vouFieldVO.getHalign());
                        voucherDetailVO.setX(x);
                        voucherDetailVO.setY(y);
                        voucherDetailVO.setXx(x1);
                        voucherDetailVO.setYy(y);
                        voucherDetailVO.setField("bmillion");
                        voucherDetailVO.setFieldType("String");
                        voucherDetailVO.setFieldValue(bmillion);
                        voucherDetailVO.setMaxlength(vouFieldVO.getMaxlength());
                        voucherDetailVO.setIsnewline(vouFieldVO.getIsnewline());
                        listDe.add(voucherDetailVO);
                    }
                }
                if (vouFieldVO.getField().trim().equals("bten")) {
                    if (!bten.equals("") && !bten.equals("-1")) {
                        x = Integer.parseInt(pos.split(",")[0]);
                        y = Integer.parseInt(pos.split(",")[1]);
                        x1 = Integer.parseInt(pos1.split(",")[0]);
                        VoucherDetailVO voucherDetailVO = new VoucherDetailVO();
                        voucherDetailVO.setVoVdSn(IdWorker.getOrderCode(busitype));
                        voucherDetailVO.setVoDeSn(VO_SN);
                        voucherDetailVO.setOrderbillsn(ORDERBILLSN);

                        Color color = Color.BLACK;
                        String cc = ImageUtils.Color2String(color);

                        voucherDetailVO.setAlpha(1);
                        voucherDetailVO.setFontcolor(cc);
                        voucherDetailVO.setFontname("宋体");

                        voucherDetailVO.setFontsize(40);
                        voucherDetailVO.setHalign(vouFieldVO.getHalign());
                        voucherDetailVO.setX(x);
                        voucherDetailVO.setY(y);
                        voucherDetailVO.setXx(x1);
                        voucherDetailVO.setYy(y);
                        voucherDetailVO.setField("bten");
                        voucherDetailVO.setFieldType("String");
                        voucherDetailVO.setFieldValue(bten);
                        voucherDetailVO.setMaxlength(vouFieldVO.getMaxlength());
                        voucherDetailVO.setIsnewline(vouFieldVO.getIsnewline());
                        listDe.add(voucherDetailVO);
                    }
                }
                if (vouFieldVO.getField().trim().equals("bthousand")) {
                    if (!bthousand.equals("") && !bthousand.equals("-1")) {
                        x = Integer.parseInt(pos.split(",")[0]);
                        y = Integer.parseInt(pos.split(",")[1]);
                        x1 = Integer.parseInt(pos1.split(",")[0]);
                        VoucherDetailVO voucherDetailVO = new VoucherDetailVO();
                        voucherDetailVO.setVoVdSn(IdWorker.getOrderCode(busitype));
                        voucherDetailVO.setVoDeSn(VO_SN);
                        voucherDetailVO.setOrderbillsn(ORDERBILLSN);

                        Color color = Color.BLACK;
                        String cc = ImageUtils.Color2String(color);

                        voucherDetailVO.setAlpha(1);
                        voucherDetailVO.setFontcolor(cc);
                        voucherDetailVO.setFontname("宋体");

                        voucherDetailVO.setFontsize(40);
                        voucherDetailVO.setHalign(vouFieldVO.getHalign());
                        voucherDetailVO.setX(x);
                        voucherDetailVO.setY(y);
                        voucherDetailVO.setXx(x1);
                        voucherDetailVO.setYy(y);
                        voucherDetailVO.setField("bthousand");
                        voucherDetailVO.setFieldType("String");
                        voucherDetailVO.setFieldValue(bthousand);
                        voucherDetailVO.setMaxlength(vouFieldVO.getMaxlength());
                        voucherDetailVO.setIsnewline(vouFieldVO.getIsnewline());
                        listDe.add(voucherDetailVO);
                    }
                }
                if (vouFieldVO.getField().trim().equals("btmillion")) {
                    if (!btmillion.equals("") && !btmillion.equals("-1")) {
                        x = Integer.parseInt(pos.split(",")[0]);
                        y = Integer.parseInt(pos.split(",")[1]);
                        x1 = Integer.parseInt(pos1.split(",")[0]);
                        VoucherDetailVO voucherDetailVO = new VoucherDetailVO();
                        voucherDetailVO.setVoVdSn(IdWorker.getOrderCode(busitype));
                        voucherDetailVO.setVoDeSn(VO_SN);
                        voucherDetailVO.setOrderbillsn(ORDERBILLSN);

                        Color color = Color.BLACK;
                        String cc = ImageUtils.Color2String(color);

                        voucherDetailVO.setAlpha(1);
                        voucherDetailVO.setFontcolor(cc);
                        voucherDetailVO.setFontname("宋体");

                        voucherDetailVO.setFontsize(40);
                        voucherDetailVO.setHalign(vouFieldVO.getHalign());
                        voucherDetailVO.setX(x);
                        voucherDetailVO.setY(y);
                        voucherDetailVO.setXx(x1);
                        voucherDetailVO.setYy(y);
                        voucherDetailVO.setField("btmillion");
                        voucherDetailVO.setFieldType("String");
                        voucherDetailVO.setFieldValue(btmillion);
                        voucherDetailVO.setMaxlength(vouFieldVO.getMaxlength());
                        voucherDetailVO.setIsnewline(vouFieldVO.getIsnewline());
                        listDe.add(voucherDetailVO);
                    }
                }
                if (vouFieldVO.getField().trim().equals("btthousand")) {
                    if (!btthousand.equals("") && !btthousand.equals("-1")) {
                        x = Integer.parseInt(pos.split(",")[0]);
                        y = Integer.parseInt(pos.split(",")[1]);
                        x1 = Integer.parseInt(pos1.split(",")[0]);
                        VoucherDetailVO voucherDetailVO = new VoucherDetailVO();
                        voucherDetailVO.setVoVdSn(IdWorker.getOrderCode(busitype));
                        voucherDetailVO.setVoDeSn(VO_SN);
                        voucherDetailVO.setOrderbillsn(ORDERBILLSN);

                        Color color = Color.BLACK;
                        String cc = ImageUtils.Color2String(color);

                        voucherDetailVO.setAlpha(1);
                        voucherDetailVO.setFontcolor(cc);
                        voucherDetailVO.setFontname("宋体");

                        voucherDetailVO.setFontsize(40);
                        voucherDetailVO.setHalign(vouFieldVO.getHalign());
                        voucherDetailVO.setX(x);
                        voucherDetailVO.setY(y);
                        voucherDetailVO.setXx(x1);
                        voucherDetailVO.setYy(y);
                        voucherDetailVO.setField("btthousand");
                        voucherDetailVO.setFieldType("String");
                        voucherDetailVO.setFieldValue(btthousand);
                        voucherDetailVO.setMaxlength(vouFieldVO.getMaxlength());
                        voucherDetailVO.setIsnewline(vouFieldVO.getIsnewline());
                        listDe.add(voucherDetailVO);
                    }
                }
                if (vouFieldVO.getField().trim().equals("byuan")) {
                    if (!byuan.equals("") && !byuan.equals("-1")) {
                        x = Integer.parseInt(pos.split(",")[0]);
                        y = Integer.parseInt(pos.split(",")[1]);
                        x1 = Integer.parseInt(pos1.split(",")[0]);
                        VoucherDetailVO voucherDetailVO = new VoucherDetailVO();
                        voucherDetailVO.setVoVdSn(IdWorker.getOrderCode(busitype));
                        voucherDetailVO.setVoDeSn(VO_SN);
                        voucherDetailVO.setOrderbillsn(ORDERBILLSN);

                        Color color = Color.BLACK;
                        String cc = ImageUtils.Color2String(color);

                        voucherDetailVO.setAlpha(1);
                        voucherDetailVO.setFontcolor(cc);
                        voucherDetailVO.setFontname("宋体");

                        voucherDetailVO.setFontsize(40);
                        voucherDetailVO.setHalign(vouFieldVO.getHalign());
                        voucherDetailVO.setX(x);
                        voucherDetailVO.setY(y);
                        voucherDetailVO.setXx(x1);
                        voucherDetailVO.setYy(y);
                        voucherDetailVO.setField("byuan");
                        voucherDetailVO.setFieldType("String");
                        voucherDetailVO.setFieldValue(byuan);
                        voucherDetailVO.setMaxlength(vouFieldVO.getMaxlength());
                        voucherDetailVO.setIsnewline(vouFieldVO.getIsnewline());
                        listDe.add(voucherDetailVO);
                    }
                }
                if (vouFieldVO.getField().trim().equals("dfen")) {
                    if (!dfen.equals("") && !dfen.equals("-1")) {
                        String[] posId = pos.split("\\|");
                        x = Integer.parseInt(posId[0].split(",")[0]);
                        y = Integer.parseInt(posId[0].split(",")[1]);
                        String[] posId1 = pos1.split("\\|");
                        x1 = Integer.parseInt(posId1[0].split(",")[0]);

                        VoucherDetailVO voucherDetailVO = new VoucherDetailVO();
                        voucherDetailVO.setVoVdSn(IdWorker.getOrderCode(busitype));
                        voucherDetailVO.setVoDeSn(VO_SN);
                        voucherDetailVO.setOrderbillsn(ORDERBILLSN);

                        Color color = Color.BLACK;
                        String cc = ImageUtils.Color2String(color);

                        voucherDetailVO.setAlpha(1);
                        voucherDetailVO.setFontcolor(cc);
                        voucherDetailVO.setFontname("宋体");

                        voucherDetailVO.setFontsize(40);
                        voucherDetailVO.setHalign(vouFieldVO.getHalign());
                        voucherDetailVO.setX(x);
                        voucherDetailVO.setY(y);
                        voucherDetailVO.setXx(x1);
                        voucherDetailVO.setYy(y);
                        voucherDetailVO.setField("dfen");
                        voucherDetailVO.setFieldType("String");
                        voucherDetailVO.setFieldValue(dfen);
                        voucherDetailVO.setMaxlength(vouFieldVO.getMaxlength());
                        voucherDetailVO.setIsnewline(vouFieldVO.getIsnewline());
                        listDe.add(voucherDetailVO);
                    }

                }
                if (vouFieldVO.getField().trim().equals("dhmillion")) {
                    if (!dhmillion.equals("") && !dhmillion.equals("-1")) {
                        String[] posId = pos.split("\\|");
                        x = Integer.parseInt(posId[0].split(",")[0]);
                        y = Integer.parseInt(posId[0].split(",")[1]);
                        String[] posId1 = pos1.split("\\|");
                        x1 = Integer.parseInt(posId1[0].split(",")[0]);

                        VoucherDetailVO voucherDetailVO = new VoucherDetailVO();
                        voucherDetailVO.setVoVdSn(IdWorker.getOrderCode(busitype));
                        voucherDetailVO.setVoDeSn(VO_SN);
                        voucherDetailVO.setOrderbillsn(ORDERBILLSN);

                        Color color = Color.BLACK;
                        String cc = ImageUtils.Color2String(color);

                        voucherDetailVO.setAlpha(1);
                        voucherDetailVO.setFontcolor(cc);
                        voucherDetailVO.setFontname("宋体");

                        voucherDetailVO.setFontsize(40);
                        voucherDetailVO.setHalign(vouFieldVO.getHalign());
                        voucherDetailVO.setX(x);
                        voucherDetailVO.setY(y);
                        voucherDetailVO.setXx(x1);
                        voucherDetailVO.setYy(y);
                        voucherDetailVO.setField("dhmillion");
                        voucherDetailVO.setFieldType("String");
                        voucherDetailVO.setFieldValue(dhmillion);
                        voucherDetailVO.setMaxlength(vouFieldVO.getMaxlength());
                        voucherDetailVO.setIsnewline(vouFieldVO.getIsnewline());
                        listDe.add(voucherDetailVO);
                    }

                }
                if (vouFieldVO.getField().trim().equals("dhthousand")) {

                    if (!dhthousand.equals("") && !dhthousand.equals("-1")) {
                        String[] posId = pos.split("\\|");
                        x = Integer.parseInt(posId[0].split(",")[0]);
                        y = Integer.parseInt(posId[0].split(",")[1]);
                        String[] posId1 = pos1.split("\\|");
                        x1 = Integer.parseInt(posId1[0].split(",")[0]);

                        VoucherDetailVO voucherDetailVO = new VoucherDetailVO();
                        voucherDetailVO.setVoVdSn(IdWorker.getOrderCode(busitype));
                        voucherDetailVO.setVoDeSn(VO_SN);
                        voucherDetailVO.setOrderbillsn(ORDERBILLSN);

                        Color color = Color.BLACK;
                        String cc = ImageUtils.Color2String(color);

                        voucherDetailVO.setAlpha(1);
                        voucherDetailVO.setFontcolor(cc);
                        voucherDetailVO.setFontname("宋体");

                        voucherDetailVO.setFontsize(40);
                        voucherDetailVO.setHalign(vouFieldVO.getHalign());
                        voucherDetailVO.setX(x);
                        voucherDetailVO.setY(y);
                        voucherDetailVO.setXx(x1);
                        voucherDetailVO.setYy(y);
                        voucherDetailVO.setField("dhthousand");
                        voucherDetailVO.setFieldType("String");
                        voucherDetailVO.setFieldValue(dhthousand);
                        voucherDetailVO.setMaxlength(vouFieldVO.getMaxlength());
                        voucherDetailVO.setIsnewline(vouFieldVO.getIsnewline());
                        listDe.add(voucherDetailVO);
                    }

                }
                if (vouFieldVO.getField().trim().equals("dhundred")) {

                    if (!dhundred.equals("") && !dhundred.equals("-1")) {
                        String[] posId = pos.split("\\|");
                        x = Integer.parseInt(posId[0].split(",")[0]);
                        y = Integer.parseInt(posId[0].split(",")[1]);
                        String[] posId1 = pos1.split("\\|");
                        x1 = Integer.parseInt(posId1[0].split(",")[0]);

                        VoucherDetailVO voucherDetailVO = new VoucherDetailVO();
                        voucherDetailVO.setVoVdSn(IdWorker.getOrderCode(busitype));
                        voucherDetailVO.setVoDeSn(VO_SN);
                        voucherDetailVO.setOrderbillsn(ORDERBILLSN);

                        Color color = Color.BLACK;
                        String cc = ImageUtils.Color2String(color);

                        voucherDetailVO.setAlpha(1);
                        voucherDetailVO.setFontcolor(cc);
                        voucherDetailVO.setFontname("宋体");

                        voucherDetailVO.setFontsize(40);
                        voucherDetailVO.setHalign(vouFieldVO.getHalign());
                        voucherDetailVO.setX(x);
                        voucherDetailVO.setY(y);
                        voucherDetailVO.setXx(x1);
                        voucherDetailVO.setYy(y);
                        voucherDetailVO.setField("dhundred");
                        voucherDetailVO.setFieldType("String");
                        voucherDetailVO.setFieldValue(dhundred);
                        voucherDetailVO.setMaxlength(vouFieldVO.getMaxlength());
                        voucherDetailVO.setIsnewline(vouFieldVO.getIsnewline());
                        listDe.add(voucherDetailVO);
                    }

                }
                if (vouFieldVO.getField().trim().equals("djiao")) {

                    if (!djiao.equals("") && !djiao.equals("-1")) {
                        String[] posId = pos.split("\\|");
                        x = Integer.parseInt(posId[0].split(",")[0]);
                        y = Integer.parseInt(posId[0].split(",")[1]);
                        String[] posId1 = pos1.split("\\|");
                        x1 = Integer.parseInt(posId1[0].split(",")[0]);

                        VoucherDetailVO voucherDetailVO = new VoucherDetailVO();
                        voucherDetailVO.setVoVdSn(IdWorker.getOrderCode(busitype));
                        voucherDetailVO.setVoDeSn(VO_SN);
                        voucherDetailVO.setOrderbillsn(ORDERBILLSN);

                        Color color = Color.BLACK;
                        String cc = ImageUtils.Color2String(color);

                        voucherDetailVO.setAlpha(1);
                        voucherDetailVO.setFontcolor(cc);
                        voucherDetailVO.setFontname("宋体");

                        voucherDetailVO.setFontsize(40);
                        voucherDetailVO.setHalign(vouFieldVO.getHalign());
                        voucherDetailVO.setX(x);
                        voucherDetailVO.setY(y);
                        voucherDetailVO.setXx(x1);
                        voucherDetailVO.setYy(y);
                        voucherDetailVO.setField("djiao");
                        voucherDetailVO.setFieldType("String");
                        voucherDetailVO.setFieldValue(djiao);
                        voucherDetailVO.setMaxlength(vouFieldVO.getMaxlength());
                        voucherDetailVO.setIsnewline(vouFieldVO.getIsnewline());
                        listDe.add(voucherDetailVO);
                    }

                }
                if (vouFieldVO.getField().trim().equals("dmillion")) {

                    if (!dmillion.equals("") && !dmillion.equals("-1")) {
                        String[] posId = pos.split("\\|");
                        x = Integer.parseInt(posId[0].split(",")[0]);
                        y = Integer.parseInt(posId[0].split(",")[1]);
                        String[] posId1 = pos1.split("\\|");
                        x1 = Integer.parseInt(posId1[0].split(",")[0]);

                        VoucherDetailVO voucherDetailVO = new VoucherDetailVO();
                        voucherDetailVO.setVoVdSn(IdWorker.getOrderCode(busitype));
                        voucherDetailVO.setVoDeSn(VO_SN);
                        voucherDetailVO.setOrderbillsn(ORDERBILLSN);

                        Color color = Color.BLACK;
                        String cc = ImageUtils.Color2String(color);

                        voucherDetailVO.setAlpha(1);
                        voucherDetailVO.setFontcolor(cc);
                        voucherDetailVO.setFontname("宋体");

                        voucherDetailVO.setFontsize(40);
                        voucherDetailVO.setHalign(vouFieldVO.getHalign());
                        voucherDetailVO.setX(x);
                        voucherDetailVO.setY(y);
                        voucherDetailVO.setXx(x1);
                        voucherDetailVO.setYy(y);
                        voucherDetailVO.setField("dmillion");
                        voucherDetailVO.setFieldType("String");
                        voucherDetailVO.setFieldValue(dmillion);
                        voucherDetailVO.setMaxlength(vouFieldVO.getMaxlength());
                        voucherDetailVO.setIsnewline(vouFieldVO.getIsnewline());
                        listDe.add(voucherDetailVO);
                    }

                }
                if (vouFieldVO.getField().trim().equals("dten")) {

                    if (!dten.equals("") && !dten.equals("-1")) {
                        String[] posId = pos.split("\\|");
                        x = Integer.parseInt(posId[0].split(",")[0]);
                        y = Integer.parseInt(posId[0].split(",")[1]);
                        String[] posId1 = pos1.split("\\|");
                        x1 = Integer.parseInt(posId1[0].split(",")[0]);

                        VoucherDetailVO voucherDetailVO = new VoucherDetailVO();
                        voucherDetailVO.setVoVdSn(IdWorker.getOrderCode(busitype));
                        voucherDetailVO.setVoDeSn(VO_SN);
                        voucherDetailVO.setOrderbillsn(ORDERBILLSN);

                        Color color = Color.BLACK;
                        String cc = ImageUtils.Color2String(color);

                        voucherDetailVO.setAlpha(1);
                        voucherDetailVO.setFontcolor(cc);
                        voucherDetailVO.setFontname("宋体");

                        voucherDetailVO.setFontsize(40);
                        voucherDetailVO.setHalign(vouFieldVO.getHalign());
                        voucherDetailVO.setX(x);
                        voucherDetailVO.setY(y);
                        voucherDetailVO.setXx(x1);
                        voucherDetailVO.setYy(y);
                        voucherDetailVO.setField("dten");
                        voucherDetailVO.setFieldType("String");
                        voucherDetailVO.setFieldValue(dten);
                        voucherDetailVO.setMaxlength(vouFieldVO.getMaxlength());
                        voucherDetailVO.setIsnewline(vouFieldVO.getIsnewline());
                        listDe.add(voucherDetailVO);
                    }

                }
                if (vouFieldVO.getField().trim().equals("dthousand")) {

                    if (!dthousand.equals("") && !dthousand.equals("-1")) {
                        String[] posId = pos.split("\\|");
                        x = Integer.parseInt(posId[0].split(",")[0]);
                        y = Integer.parseInt(posId[0].split(",")[1]);
                        String[] posId1 = pos1.split("\\|");
                        x1 = Integer.parseInt(posId1[0].split(",")[0]);

                        VoucherDetailVO voucherDetailVO = new VoucherDetailVO();
                        voucherDetailVO.setVoVdSn(IdWorker.getOrderCode(busitype));
                        voucherDetailVO.setVoDeSn(VO_SN);
                        voucherDetailVO.setOrderbillsn(ORDERBILLSN);

                        Color color = Color.BLACK;
                        String cc = ImageUtils.Color2String(color);

                        voucherDetailVO.setAlpha(1);
                        voucherDetailVO.setFontcolor(cc);
                        voucherDetailVO.setFontname("宋体");

                        voucherDetailVO.setFontsize(40);
                        voucherDetailVO.setHalign(vouFieldVO.getHalign());
                        voucherDetailVO.setX(x);
                        voucherDetailVO.setY(y);
                        voucherDetailVO.setXx(x1);
                        voucherDetailVO.setYy(y);
                        voucherDetailVO.setField("dthousand");
                        voucherDetailVO.setFieldType("String");
                        voucherDetailVO.setFieldValue(dthousand);
                        voucherDetailVO.setMaxlength(vouFieldVO.getMaxlength());
                        voucherDetailVO.setIsnewline(vouFieldVO.getIsnewline());
                        listDe.add(voucherDetailVO);
                    }

                }
                if (vouFieldVO.getField().trim().equals("dtmillion")) {

                    if (!dtmillion.equals("") && !dtmillion.equals("-1")) {
                        String[] posId = pos.split("\\|");
                        x = Integer.parseInt(posId[0].split(",")[0]);
                        y = Integer.parseInt(posId[0].split(",")[1]);
                        String[] posId1 = pos1.split("\\|");
                        x1 = Integer.parseInt(posId1[0].split(",")[0]);

                        VoucherDetailVO voucherDetailVO = new VoucherDetailVO();
                        voucherDetailVO.setVoVdSn(IdWorker.getOrderCode(busitype));
                        voucherDetailVO.setVoDeSn(VO_SN);
                        voucherDetailVO.setOrderbillsn(ORDERBILLSN);

                        Color color = Color.BLACK;
                        String cc = ImageUtils.Color2String(color);

                        voucherDetailVO.setAlpha(1);
                        voucherDetailVO.setFontcolor(cc);
                        voucherDetailVO.setFontname("宋体");

                        voucherDetailVO.setFontsize(40);
                        voucherDetailVO.setHalign(vouFieldVO.getHalign());
                        voucherDetailVO.setX(x);
                        voucherDetailVO.setY(y);
                        voucherDetailVO.setXx(x1);
                        voucherDetailVO.setYy(y);
                        voucherDetailVO.setField("dtmillion");
                        voucherDetailVO.setFieldType("String");
                        voucherDetailVO.setFieldValue(dtmillion);
                        voucherDetailVO.setMaxlength(vouFieldVO.getMaxlength());
                        voucherDetailVO.setIsnewline(vouFieldVO.getIsnewline());
                        listDe.add(voucherDetailVO);
                    }

                }
                if (vouFieldVO.getField().trim().equals("dtthousand")) {

                    if (!dtthousand.equals("") && !dtthousand.equals("-1")) {
                        String[] posId = pos.split("\\|");
                        x = Integer.parseInt(posId[0].split(",")[0]);
                        y = Integer.parseInt(posId[0].split(",")[1]);
                        String[] posId1 = pos1.split("\\|");
                        x1 = Integer.parseInt(posId1[0].split(",")[0]);

                        VoucherDetailVO voucherDetailVO = new VoucherDetailVO();
                        voucherDetailVO.setVoVdSn(IdWorker.getOrderCode(busitype));
                        voucherDetailVO.setVoDeSn(VO_SN);
                        voucherDetailVO.setOrderbillsn(ORDERBILLSN);

                        Color color = Color.BLACK;
                        String cc = ImageUtils.Color2String(color);

                        voucherDetailVO.setAlpha(1);
                        voucherDetailVO.setFontcolor(cc);
                        voucherDetailVO.setFontname("宋体");

                        voucherDetailVO.setFontsize(40);
                        voucherDetailVO.setHalign(vouFieldVO.getHalign());
                        voucherDetailVO.setX(x);
                        voucherDetailVO.setY(y);
                        voucherDetailVO.setXx(x1);
                        voucherDetailVO.setYy(y);
                        voucherDetailVO.setField("dtthousand");
                        voucherDetailVO.setFieldType("String");
                        voucherDetailVO.setFieldValue(dtthousand);
                        voucherDetailVO.setMaxlength(vouFieldVO.getMaxlength());
                        voucherDetailVO.setIsnewline(vouFieldVO.getIsnewline());
                        listDe.add(voucherDetailVO);
                    }

                }
                if (vouFieldVO.getField().trim().equals("dyuan")) {

                    if (!dyuan.equals("") && !dyuan.equals("-1")) {
                        String[] posId = pos.split("\\|");
                        x = Integer.parseInt(posId[0].split(",")[0]);
                        y = Integer.parseInt(posId[0].split(",")[1]);
                        String[] posId1 = pos1.split("\\|");
                        x1 = Integer.parseInt(posId1[0].split(",")[0]);

                        VoucherDetailVO voucherDetailVO = new VoucherDetailVO();
                        voucherDetailVO.setVoVdSn(IdWorker.getOrderCode(busitype));
                        voucherDetailVO.setVoDeSn(VO_SN);
                        voucherDetailVO.setOrderbillsn(ORDERBILLSN);

                        Color color = Color.BLACK;
                        String cc = ImageUtils.Color2String(color);

                        voucherDetailVO.setAlpha(1);
                        voucherDetailVO.setFontcolor(cc);
                        voucherDetailVO.setFontname("宋体");

                        voucherDetailVO.setFontsize(40);
                        voucherDetailVO.setHalign(vouFieldVO.getHalign());
                        voucherDetailVO.setX(x);
                        voucherDetailVO.setY(y);
                        voucherDetailVO.setXx(x1);
                        voucherDetailVO.setYy(y);
                        voucherDetailVO.setField("dyuan");
                        voucherDetailVO.setFieldType("String");
                        voucherDetailVO.setFieldValue(dyuan);
                        voucherDetailVO.setMaxlength(vouFieldVO.getMaxlength());
                        voucherDetailVO.setIsnewline(vouFieldVO.getIsnewline());
                        listDe.add(voucherDetailVO);
                    }

                }
                if (vouFieldVO.getField().trim().equals("expcode")) {


                    String[] posId = pos.split("\\|");
                    x = Integer.parseInt(posId[0].split(",")[0]);
                    y = Integer.parseInt(posId[0].split(",")[1]);

                    VoucherDetailVO voucherDetailVO = new VoucherDetailVO();
                    voucherDetailVO.setVoVdSn(IdWorker.getOrderCode(busitype));
                    voucherDetailVO.setVoDeSn(VO_SN);
                    voucherDetailVO.setOrderbillsn(ORDERBILLSN);

                    Color color = Color.BLACK;
                    String cc = ImageUtils.Color2String(color);

                    voucherDetailVO.setAlpha(1);
                    voucherDetailVO.setFontcolor(cc);
                    voucherDetailVO.setFontname("宋体");

                    voucherDetailVO.setFontsize(40);
                    voucherDetailVO.setHalign(vouFieldVO.getHalign());
                    voucherDetailVO.setX(x);
                    voucherDetailVO.setY(y);
                    voucherDetailVO.setField("expcode");
                    voucherDetailVO.setFieldType("String");
                    voucherDetailVO.setFieldValue(special.getItemCode());
                    voucherDetailVO.setMaxlength(vouFieldVO.getMaxlength());
                    voucherDetailVO.setIsnewline(vouFieldVO.getIsnewline());
                    listDe.add(voucherDetailVO);


                }
                if (vouFieldVO.getField().trim().equals("expname")) {

                    String[] posId = pos.split("\\|");
                    x = Integer.parseInt(posId[0].split(",")[0]);
                    y = Integer.parseInt(posId[0].split(",")[1]);

                    VoucherDetailVO voucherDetailVO = new VoucherDetailVO();
                    voucherDetailVO.setVoVdSn(IdWorker.getOrderCode(busitype));
                    voucherDetailVO.setVoDeSn(VO_SN);
                    voucherDetailVO.setOrderbillsn(ORDERBILLSN);

                    Color color = Color.BLACK;
                    String cc = ImageUtils.Color2String(color);

                    voucherDetailVO.setAlpha(1);
                    voucherDetailVO.setFontcolor(cc);
                    voucherDetailVO.setFontname("宋体");

                    voucherDetailVO.setFontsize(40);
                    voucherDetailVO.setHalign(vouFieldVO.getHalign());
                    voucherDetailVO.setX(x);
                    voucherDetailVO.setY(y);
                    voucherDetailVO.setField("expname");
                    voucherDetailVO.setFieldType("String");
                    voucherDetailVO.setFieldValue(special.getItemName());
                    voucherDetailVO.setMaxlength(vouFieldVO.getMaxlength());
                    voucherDetailVO.setIsnewline(vouFieldVO.getIsnewline());
                    listDe.add(voucherDetailVO);

                }
                if (vouFieldVO.getField().trim().equals("fen")) {
                    if (!fen.equals("") && !fen.equals("-1")) {
                        x = Integer.parseInt(pos.split(",")[0]);
                        y = Integer.parseInt(pos.split(",")[1]);
                        x1 = Integer.parseInt(pos1.split(",")[0]);
                        VoucherDetailVO voucherDetailVO = new VoucherDetailVO();
                        voucherDetailVO.setVoVdSn(IdWorker.getOrderCode(busitype));
                        voucherDetailVO.setVoDeSn(VO_SN);
                        voucherDetailVO.setOrderbillsn(ORDERBILLSN);

                        Color color = Color.BLACK;
                        String cc = ImageUtils.Color2String(color);

                        voucherDetailVO.setAlpha(1);
                        voucherDetailVO.setFontcolor(cc);
                        voucherDetailVO.setFontname("宋体");

                        voucherDetailVO.setFontsize(40);
                        voucherDetailVO.setHalign(vouFieldVO.getHalign());
                        voucherDetailVO.setX(x);
                        voucherDetailVO.setY(y);
                        voucherDetailVO.setXx(x1);
                        voucherDetailVO.setYy(y);
                        voucherDetailVO.setField("fen");
                        voucherDetailVO.setFieldType("String");
                        voucherDetailVO.setFieldValue(fen);
                        voucherDetailVO.setMaxlength(vouFieldVO.getMaxlength());
                        voucherDetailVO.setIsnewline(vouFieldVO.getIsnewline());
                        listDe.add(voucherDetailVO);
                    }
                }
                if (vouFieldVO.getField().trim().equals("fillday")) {

                    VoucherDetailVO voucherDetailVO = new VoucherDetailVO();
                    voucherDetailVO.setVoVdSn(IdWorker.getOrderCode(busitype));
                    voucherDetailVO.setVoDeSn(VO_SN);
                    voucherDetailVO.setOrderbillsn(ORDERBILLSN);

                    Color color = Color.BLACK;
                    String cc = ImageUtils.Color2String(color);
                    x = Integer.parseInt(pos.split(",")[0]);
                    y = Integer.parseInt(pos.split(",")[1]);

                    voucherDetailVO.setAlpha(1);
                    voucherDetailVO.setFontcolor(cc);
                    voucherDetailVO.setFontname("宋体");

                    voucherDetailVO.setFontsize(40);
                    voucherDetailVO.setHalign(vouFieldVO.getHalign());
                    voucherDetailVO.setX(x);
                    voucherDetailVO.setY(y);
                    voucherDetailVO.setField("fillday");
                    voucherDetailVO.setFieldType("String");
                    SimpleDateFormat formatD = new SimpleDateFormat("dd");
                    voucherDetailVO.setFieldValue(formatD.format(new Date()));
                    voucherDetailVO.setMaxlength(vouFieldVO.getMaxlength());
                    voucherDetailVO.setIsnewline(vouFieldVO.getIsnewline());
                    listDe.add(voucherDetailVO);

                }
                if (vouFieldVO.getField().trim().equals("fillyear")) {
                    VoucherDetailVO voucherDetailVO = new VoucherDetailVO();
                    voucherDetailVO.setVoVdSn(IdWorker.getOrderCode(busitype));
                    voucherDetailVO.setVoDeSn(VO_SN);
                    voucherDetailVO.setOrderbillsn(ORDERBILLSN);

                    Color color = Color.BLACK;
                    String cc = ImageUtils.Color2String(color);
                    x = Integer.parseInt(pos.split(",")[0]);
                    y = Integer.parseInt(pos.split(",")[1]);

                    voucherDetailVO.setAlpha(1);
                    voucherDetailVO.setFontcolor(cc);
                    voucherDetailVO.setFontname("宋体");

                    voucherDetailVO.setFontsize(40);
                    voucherDetailVO.setHalign(vouFieldVO.getHalign());
                    voucherDetailVO.setX(x);
                    voucherDetailVO.setY(y);
                    voucherDetailVO.setField("fillyear");
                    voucherDetailVO.setFieldType("String");
                    SimpleDateFormat formatD = new SimpleDateFormat("yyyy");
                    voucherDetailVO.setFieldValue(formatD.format(new Date()));
                    voucherDetailVO.setMaxlength(vouFieldVO.getMaxlength());
                    voucherDetailVO.setIsnewline(vouFieldVO.getIsnewline());
                    listDe.add(voucherDetailVO);
                }
                if (vouFieldVO.getField().trim().equals("fillmonth")) {
                    VoucherDetailVO voucherDetailVO = new VoucherDetailVO();
                    voucherDetailVO.setVoVdSn(IdWorker.getOrderCode(busitype));
                    voucherDetailVO.setVoDeSn(VO_SN);
                    voucherDetailVO.setOrderbillsn(ORDERBILLSN);

                    Color color = Color.BLACK;
                    String cc = ImageUtils.Color2String(color);
                    x = Integer.parseInt(pos.split(",")[0]);
                    y = Integer.parseInt(pos.split(",")[1]);

                    voucherDetailVO.setAlpha(1);
                    voucherDetailVO.setFontcolor(cc);
                    voucherDetailVO.setFontname("宋体");

                    voucherDetailVO.setFontsize(40);
                    voucherDetailVO.setHalign(vouFieldVO.getHalign());
                    voucherDetailVO.setX(x);
                    voucherDetailVO.setY(y);
                    voucherDetailVO.setField("fillmonth");
                    voucherDetailVO.setFieldType("String");
                    SimpleDateFormat formatD = new SimpleDateFormat("MM");
                    voucherDetailVO.setFieldValue(formatD.format(new Date()));
                    voucherDetailVO.setMaxlength(vouFieldVO.getMaxlength());
                    voucherDetailVO.setIsnewline(vouFieldVO.getIsnewline());
                    listDe.add(voucherDetailVO);
                }

                if (vouFieldVO.getField().trim().equals("hmillion")) {
                    if (!hmillion.equals("") && !hmillion.equals("-1")) {
                        x = Integer.parseInt(pos.split(",")[0]);
                        y = Integer.parseInt(pos.split(",")[1]);
                        x1 = Integer.parseInt(pos1.split(",")[0]);
                        VoucherDetailVO voucherDetailVO = new VoucherDetailVO();
                        voucherDetailVO.setVoVdSn(IdWorker.getOrderCode(busitype));
                        voucherDetailVO.setVoDeSn(VO_SN);
                        voucherDetailVO.setOrderbillsn(ORDERBILLSN);

                        Color color = Color.BLACK;
                        String cc = ImageUtils.Color2String(color);

                        voucherDetailVO.setAlpha(1);
                        voucherDetailVO.setFontcolor(cc);
                        voucherDetailVO.setFontname("宋体");

                        voucherDetailVO.setFontsize(40);
                        voucherDetailVO.setHalign(vouFieldVO.getHalign());
                        voucherDetailVO.setX(x);
                        voucherDetailVO.setY(y);
                        voucherDetailVO.setXx(x1);
                        voucherDetailVO.setYy(y);
                        voucherDetailVO.setField("hmillion");
                        voucherDetailVO.setFieldType("String");
                        voucherDetailVO.setFieldValue(hmillion);
                        voucherDetailVO.setMaxlength(vouFieldVO.getMaxlength());
                        voucherDetailVO.setIsnewline(vouFieldVO.getIsnewline());
                        listDe.add(voucherDetailVO);
                    }
                }
                if (vouFieldVO.getField().trim().equals("hthousand")) {
                    if (!hthousand.equals("") && !hthousand.equals("-1")) {
                        x = Integer.parseInt(pos.split(",")[0]);
                        y = Integer.parseInt(pos.split(",")[1]);
                        x1 = Integer.parseInt(pos1.split(",")[0]);
                        VoucherDetailVO voucherDetailVO = new VoucherDetailVO();
                        voucherDetailVO.setVoVdSn(IdWorker.getOrderCode(busitype));
                        voucherDetailVO.setVoDeSn(VO_SN);
                        voucherDetailVO.setOrderbillsn(ORDERBILLSN);

                        Color color = Color.BLACK;
                        String cc = ImageUtils.Color2String(color);

                        voucherDetailVO.setAlpha(1);
                        voucherDetailVO.setFontcolor(cc);
                        voucherDetailVO.setFontname("宋体");

                        voucherDetailVO.setFontsize(40);
                        voucherDetailVO.setHalign(vouFieldVO.getHalign());
                        voucherDetailVO.setX(x);
                        voucherDetailVO.setY(y);
                        voucherDetailVO.setXx(x1);
                        voucherDetailVO.setYy(y);
                        voucherDetailVO.setField("hthousand");
                        voucherDetailVO.setFieldType("String");
                        voucherDetailVO.setFieldValue(hthousand);
                        voucherDetailVO.setMaxlength(vouFieldVO.getMaxlength());
                        voucherDetailVO.setIsnewline(vouFieldVO.getIsnewline());
                        listDe.add(voucherDetailVO);
                    }
                }
                if (vouFieldVO.getField().trim().equals("hundred")) {
                    if (!hundred.equals("") && !hundred.equals("-1")) {
                        x = Integer.parseInt(pos.split(",")[0]);
                        y = Integer.parseInt(pos.split(",")[1]);
                        x1 = Integer.parseInt(pos1.split(",")[0]);
                        VoucherDetailVO voucherDetailVO = new VoucherDetailVO();
                        voucherDetailVO.setVoVdSn(IdWorker.getOrderCode(busitype));
                        voucherDetailVO.setVoDeSn(VO_SN);
                        voucherDetailVO.setOrderbillsn(ORDERBILLSN);

                        Color color = Color.BLACK;
                        String cc = ImageUtils.Color2String(color);

                        voucherDetailVO.setAlpha(1);
                        voucherDetailVO.setFontcolor(cc);
                        voucherDetailVO.setFontname("宋体");

                        voucherDetailVO.setFontsize(40);
                        voucherDetailVO.setHalign(vouFieldVO.getHalign());
                        voucherDetailVO.setX(x);
                        voucherDetailVO.setY(y);
                        voucherDetailVO.setXx(x1);
                        voucherDetailVO.setYy(y);
                        voucherDetailVO.setField("hundred");
                        voucherDetailVO.setFieldType("String");
                        voucherDetailVO.setFieldValue(hundred);
                        voucherDetailVO.setMaxlength(vouFieldVO.getMaxlength());
                        voucherDetailVO.setIsnewline(vouFieldVO.getIsnewline());
                        listDe.add(voucherDetailVO);
                    }
                }
                if (vouFieldVO.getField().trim().equals("jiao")) {
                    if (!jiao.equals("") && !jiao.equals("-1")) {
                        x = Integer.parseInt(pos.split(",")[0]);
                        y = Integer.parseInt(pos.split(",")[1]);
                        x1 = Integer.parseInt(pos1.split(",")[0]);
                        VoucherDetailVO voucherDetailVO = new VoucherDetailVO();
                        voucherDetailVO.setVoVdSn(IdWorker.getOrderCode(busitype));
                        voucherDetailVO.setVoDeSn(VO_SN);
                        voucherDetailVO.setOrderbillsn(ORDERBILLSN);

                        Color color = Color.BLACK;
                        String cc = ImageUtils.Color2String(color);

                        voucherDetailVO.setAlpha(1);
                        voucherDetailVO.setFontcolor(cc);
                        voucherDetailVO.setFontname("宋体");

                        voucherDetailVO.setFontsize(40);
                        voucherDetailVO.setHalign(vouFieldVO.getHalign());
                        voucherDetailVO.setX(x);
                        voucherDetailVO.setY(y);
                        voucherDetailVO.setXx(x1);
                        voucherDetailVO.setYy(y);
                        voucherDetailVO.setField("jiao");
                        voucherDetailVO.setFieldType("String");
                        voucherDetailVO.setFieldValue(jiao);
                        voucherDetailVO.setMaxlength(vouFieldVO.getMaxlength());
                        voucherDetailVO.setIsnewline(vouFieldVO.getIsnewline());
                        listDe.add(voucherDetailVO);
                    }
                }
                if (vouFieldVO.getField().trim().equals("memo")) {
                    x = Integer.parseInt(pos.split(",")[0]);
                    y = Integer.parseInt(pos.split(",")[1]);
                    VoucherDetailVO voucherDetailVO = new VoucherDetailVO();
                    voucherDetailVO.setVoVdSn(IdWorker.getOrderCode(busitype));
                    voucherDetailVO.setVoDeSn(VO_SN);
                    voucherDetailVO.setOrderbillsn(ORDERBILLSN);

                    Color color = Color.BLACK;
                    String cc = ImageUtils.Color2String(color);

                    voucherDetailVO.setAlpha(1);
                    voucherDetailVO.setFontcolor(cc);
                    voucherDetailVO.setFontname("宋体");

                    voucherDetailVO.setFontsize(40);
                    voucherDetailVO.setHalign(vouFieldVO.getHalign());
                    voucherDetailVO.setX(x);
                    voucherDetailVO.setY(y);
                    voucherDetailVO.setField("memo");
                    voucherDetailVO.setFieldType("String");
                    voucherDetailVO.setFieldValue("");
                    voucherDetailVO.setMaxlength(vouFieldVO.getMaxlength());
                    voucherDetailVO.setIsnewline(vouFieldVO.getIsnewline());
                    listDe.add(voucherDetailVO);
                }
                if (vouFieldVO.getField().trim().equals("million")) {
                    if (!million.equals("") && !million.equals("-1")) {
                        x = Integer.parseInt(pos.split(",")[0]);
                        y = Integer.parseInt(pos.split(",")[1]);
                        x1 = Integer.parseInt(pos1.split(",")[0]);
                        VoucherDetailVO voucherDetailVO = new VoucherDetailVO();
                        voucherDetailVO.setVoVdSn(IdWorker.getOrderCode(busitype));
                        voucherDetailVO.setVoDeSn(VO_SN);
                        voucherDetailVO.setOrderbillsn(ORDERBILLSN);

                        Color color = Color.BLACK;
                        String cc = ImageUtils.Color2String(color);

                        voucherDetailVO.setAlpha(1);
                        voucherDetailVO.setFontcolor(cc);
                        voucherDetailVO.setFontname("宋体");

                        voucherDetailVO.setFontsize(40);
                        voucherDetailVO.setHalign(vouFieldVO.getHalign());
                        voucherDetailVO.setX(x);
                        voucherDetailVO.setY(y);
                        voucherDetailVO.setXx(x1);
                        voucherDetailVO.setYy(y);
                        voucherDetailVO.setField("million");
                        voucherDetailVO.setFieldType("String");
                        voucherDetailVO.setFieldValue(million);
                        voucherDetailVO.setMaxlength(vouFieldVO.getMaxlength());
                        voucherDetailVO.setIsnewline(vouFieldVO.getIsnewline());
                        listDe.add(voucherDetailVO);
                    }
                }

                if (vouFieldVO.getField().trim().equals("month")) {

                    String[] posId = pos.split("\\|");
                    x = Integer.parseInt(posId[0].split(",")[0]);
                    y = Integer.parseInt(posId[0].split(",")[1]);
                    String[] posId1 = pos1.split("\\|");
                    x1 = Integer.parseInt(posId1[0].split(",")[0]);

                    VoucherDetailVO voucherDetailVO = new VoucherDetailVO();
                    voucherDetailVO.setVoVdSn(IdWorker.getOrderCode(busitype));
                    voucherDetailVO.setVoDeSn(VO_SN);
                    voucherDetailVO.setOrderbillsn(ORDERBILLSN);

                    Color color = Color.BLACK;
                    String cc = ImageUtils.Color2String(color);

                    voucherDetailVO.setAlpha(1);
                    voucherDetailVO.setFontcolor(cc);
                    voucherDetailVO.setFontname("宋体");

                    voucherDetailVO.setFontsize(40);
                    voucherDetailVO.setHalign(vouFieldVO.getHalign());
                    voucherDetailVO.setX(x);
                    voucherDetailVO.setY(y);
                    voucherDetailVO.setXx(x1);
                    voucherDetailVO.setYy(y);
                    voucherDetailVO.setField("month");
                    voucherDetailVO.setFieldType("String");
                    voucherDetailVO.setFieldValue("");
                    voucherDetailVO.setMaxlength(vouFieldVO.getMaxlength());
                    voucherDetailVO.setIsnewline(vouFieldVO.getIsnewline());
                    listDe.add(voucherDetailVO);

                }

                if (vouFieldVO.getField().trim().equals("payeeunitname")) {
                    VoucherDetailVO voucherDetailVO = new VoucherDetailVO();
                    voucherDetailVO.setVoVdSn(IdWorker.getOrderCode(busitype));
                    voucherDetailVO.setVoDeSn(VO_SN);
                    voucherDetailVO.setOrderbillsn(ORDERBILLSN);

                    Color color = Color.BLACK;
                    String cc = ImageUtils.Color2String(color);
                    x = Integer.parseInt(pos.split(",")[0]);
                    y = Integer.parseInt(pos.split(",")[1]);

                    voucherDetailVO.setAlpha(1);
                    voucherDetailVO.setFontcolor(cc);
                    voucherDetailVO.setFontname("宋体");

                    voucherDetailVO.setFontsize(40);
                    voucherDetailVO.setHalign(vouFieldVO.getHalign());
                    voucherDetailVO.setX(x);
                    voucherDetailVO.setY(y);
                    voucherDetailVO.setField("payeedepart");
                    voucherDetailVO.setFieldType("String");
                    voucherDetailVO.setFieldValue(special.getPayeeUnitName());
                    voucherDetailVO.setMaxlength(vouFieldVO.getMaxlength());
                    voucherDetailVO.setIsnewline(vouFieldVO.getIsnewline());
                    listDe.add(voucherDetailVO);
                }
                if (vouFieldVO.getField().trim().equals("payeebankaccount")) {
                    VoucherDetailVO voucherDetailVO = new VoucherDetailVO();
                    voucherDetailVO.setVoVdSn(IdWorker.getOrderCode(busitype));
                    voucherDetailVO.setVoDeSn(VO_SN);
                    voucherDetailVO.setOrderbillsn(ORDERBILLSN);

                    Color color = Color.BLACK;
                    String cc = ImageUtils.Color2String(color);
                    x = Integer.parseInt(pos.split(",")[0]);
                    y = Integer.parseInt(pos.split(",")[1]);

                    voucherDetailVO.setAlpha(1);
                    voucherDetailVO.setFontcolor(cc);
                    voucherDetailVO.setFontname("宋体");

                    voucherDetailVO.setFontsize(40);
                    voucherDetailVO.setHalign(vouFieldVO.getHalign());
                    voucherDetailVO.setX(x);
                    voucherDetailVO.setY(y);
                    voucherDetailVO.setField("payeebankaccount");
                    voucherDetailVO.setFieldType("String");
                    voucherDetailVO.setFieldValue(special.getPayeeAccount());
                    voucherDetailVO.setMaxlength(vouFieldVO.getMaxlength());
                    voucherDetailVO.setIsnewline(vouFieldVO.getIsnewline());
                    listDe.add(voucherDetailVO);
                }
                if (vouFieldVO.getField().trim().equals("payeebankname")) {
                    VoucherDetailVO voucherDetailVO = new VoucherDetailVO();
                    voucherDetailVO.setVoVdSn(IdWorker.getOrderCode(busitype));
                    voucherDetailVO.setVoDeSn(VO_SN);
                    voucherDetailVO.setOrderbillsn(ORDERBILLSN);

                    Color color = Color.BLACK;
                    String cc = ImageUtils.Color2String(color);
                    x = Integer.parseInt(pos.split(",")[0]);
                    y = Integer.parseInt(pos.split(",")[1]);

                    voucherDetailVO.setAlpha(1);
                    voucherDetailVO.setFontcolor(cc);
                    voucherDetailVO.setFontname("宋体");

                    voucherDetailVO.setFontsize(40);
                    voucherDetailVO.setHalign(vouFieldVO.getHalign());
                    voucherDetailVO.setX(x);
                    voucherDetailVO.setY(y);
                    voucherDetailVO.setField("payeebankname");
                    voucherDetailVO.setFieldType("String");
                    voucherDetailVO.setFieldValue(special.getPayeeBankName());
                    voucherDetailVO.setMaxlength(vouFieldVO.getMaxlength());
                    voucherDetailVO.setIsnewline(vouFieldVO.getIsnewline());
                    listDe.add(voucherDetailVO);
                }
                if (vouFieldVO.getField().trim().equals("payeelevel")) {
                    VoucherDetailVO voucherDetailVO = new VoucherDetailVO();
                    voucherDetailVO.setVoVdSn(IdWorker.getOrderCode(busitype));
                    voucherDetailVO.setVoDeSn(VO_SN);
                    voucherDetailVO.setOrderbillsn(ORDERBILLSN);

                    Color color = Color.BLACK;
                    String cc = ImageUtils.Color2String(color);
                    x = Integer.parseInt(pos.split(",")[0]);
                    y = Integer.parseInt(pos.split(",")[1]);

                    voucherDetailVO.setAlpha(1);
                    voucherDetailVO.setFontcolor(cc);
                    voucherDetailVO.setFontname("宋体");

                    voucherDetailVO.setFontsize(40);
                    voucherDetailVO.setHalign(vouFieldVO.getHalign());
                    voucherDetailVO.setX(x);
                    voucherDetailVO.setY(y);
                    voucherDetailVO.setField("payeefisc");
                    voucherDetailVO.setFieldType("String");
                    voucherDetailVO.setFieldValue(special.getPayeeLevel());
                    voucherDetailVO.setMaxlength(vouFieldVO.getMaxlength());
                    voucherDetailVO.setIsnewline(vouFieldVO.getIsnewline());
                    listDe.add(voucherDetailVO);
                }
                if (vouFieldVO.getField().trim().equals("payeragencycode")) {
                    VoucherDetailVO voucherDetailVO = new VoucherDetailVO();
                    voucherDetailVO.setVoVdSn(IdWorker.getOrderCode(busitype));
                    voucherDetailVO.setVoDeSn(VO_SN);
                    voucherDetailVO.setOrderbillsn(ORDERBILLSN);

                    Color color = Color.BLACK;
                    String cc = ImageUtils.Color2String(color);
                    x = Integer.parseInt(pos.split(",")[0]);
                    y = Integer.parseInt(pos.split(",")[1]);

                    voucherDetailVO.setAlpha(1);
                    voucherDetailVO.setFontcolor(cc);
                    voucherDetailVO.setFontname("宋体");

                    voucherDetailVO.setFontsize(40);
                    voucherDetailVO.setHalign(vouFieldVO.getHalign());
                    voucherDetailVO.setX(x);
                    voucherDetailVO.setY(y);
                    voucherDetailVO.setField("payeragencycode");
                    voucherDetailVO.setFieldType("String");
                    voucherDetailVO.setFieldValue("");
                    voucherDetailVO.setMaxlength(vouFieldVO.getMaxlength());
                    voucherDetailVO.setIsnewline(vouFieldVO.getIsnewline());
                    listDe.add(voucherDetailVO);
                }
                if (vouFieldVO.getField().trim().equals("payerbankaccount")) {
                    VoucherDetailVO voucherDetailVO = new VoucherDetailVO();
                    voucherDetailVO.setVoVdSn(IdWorker.getOrderCode(busitype));
                    voucherDetailVO.setVoDeSn(VO_SN);
                    voucherDetailVO.setOrderbillsn(ORDERBILLSN);

                    Color color = Color.BLACK;
                    String cc = ImageUtils.Color2String(color);
                    x = Integer.parseInt(pos.split(",")[0]);
                    y = Integer.parseInt(pos.split(",")[1]);

                    voucherDetailVO.setAlpha(1);
                    voucherDetailVO.setFontcolor(cc);
                    voucherDetailVO.setFontname("宋体");

                    voucherDetailVO.setFontsize(40);
                    voucherDetailVO.setHalign(vouFieldVO.getHalign());
                    voucherDetailVO.setX(x);
                    voucherDetailVO.setY(y);
                    voucherDetailVO.setField("payerbankaccount");
                    voucherDetailVO.setFieldType("String");
                    voucherDetailVO.setFieldValue(special.getAccountCode());
                    voucherDetailVO.setMaxlength(vouFieldVO.getMaxlength());
                    voucherDetailVO.setIsnewline(vouFieldVO.getIsnewline());
                    listDe.add(voucherDetailVO);
                }
                if (vouFieldVO.getField().trim().equals("payerbankname")) {
                    VoucherDetailVO voucherDetailVO = new VoucherDetailVO();
                    voucherDetailVO.setVoVdSn(IdWorker.getOrderCode(busitype));
                    voucherDetailVO.setVoDeSn(VO_SN);
                    voucherDetailVO.setOrderbillsn(ORDERBILLSN);

                    Color color = Color.BLACK;
                    String cc = ImageUtils.Color2String(color);
                    x = Integer.parseInt(pos.split(",")[0]);
                    y = Integer.parseInt(pos.split(",")[1]);

                    voucherDetailVO.setAlpha(1);
                    voucherDetailVO.setFontcolor(cc);
                    voucherDetailVO.setFontname("宋体");

                    voucherDetailVO.setFontsize(40);
                    voucherDetailVO.setHalign(vouFieldVO.getHalign());
                    voucherDetailVO.setX(x);
                    voucherDetailVO.setY(y);
                    voucherDetailVO.setField("payerbankname");
                    voucherDetailVO.setFieldType("String");
                    voucherDetailVO.setFieldValue(special.getBankName());
                    voucherDetailVO.setMaxlength(vouFieldVO.getMaxlength());
                    voucherDetailVO.setIsnewline(vouFieldVO.getIsnewline());
                    listDe.add(voucherDetailVO);
                }
                if (vouFieldVO.getField().trim().equals("payername")) {
                    VoucherDetailVO voucherDetailVO = new VoucherDetailVO();
                    voucherDetailVO.setVoVdSn(IdWorker.getOrderCode(busitype));
                    voucherDetailVO.setVoDeSn(VO_SN);
                    voucherDetailVO.setOrderbillsn(ORDERBILLSN);

                    Color color = Color.BLACK;
                    String cc = ImageUtils.Color2String(color);
                    x = Integer.parseInt(pos.split(",")[0]);
                    y = Integer.parseInt(pos.split(",")[1]);

                    voucherDetailVO.setAlpha(1);
                    voucherDetailVO.setFontcolor(cc);
                    voucherDetailVO.setFontname("宋体");

                    voucherDetailVO.setFontsize(40);
                    voucherDetailVO.setHalign(vouFieldVO.getHalign());
                    voucherDetailVO.setX(x);
                    voucherDetailVO.setY(y);
                    voucherDetailVO.setField("payername");
                    voucherDetailVO.setFieldType("String");
                    voucherDetailVO.setFieldValue(special.getAccountName());
                    voucherDetailVO.setMaxlength(vouFieldVO.getMaxlength());
                    voucherDetailVO.setIsnewline(vouFieldVO.getIsnewline());
                    listDe.add(voucherDetailVO);
                }
                if (vouFieldVO.getField().trim().equals("ten")) {
                    if (!ten.equals("") && !ten.equals("-1")) {
                        x = Integer.parseInt(pos.split(",")[0]);
                        y = Integer.parseInt(pos.split(",")[1]);
                        x1 = Integer.parseInt(pos1.split(",")[0]);
                        VoucherDetailVO voucherDetailVO = new VoucherDetailVO();
                        voucherDetailVO.setVoVdSn(IdWorker.getOrderCode(busitype));
                        voucherDetailVO.setVoDeSn(VO_SN);
                        voucherDetailVO.setOrderbillsn(ORDERBILLSN);

                        Color color = Color.BLACK;
                        String cc = ImageUtils.Color2String(color);

                        voucherDetailVO.setAlpha(1);
                        voucherDetailVO.setFontcolor(cc);
                        voucherDetailVO.setFontname("宋体");

                        voucherDetailVO.setFontsize(40);
                        voucherDetailVO.setHalign(vouFieldVO.getHalign());
                        voucherDetailVO.setX(x);
                        voucherDetailVO.setY(y);
                        voucherDetailVO.setXx(x1);
                        voucherDetailVO.setYy(y);
                        voucherDetailVO.setField("ten");
                        voucherDetailVO.setFieldType("String");
                        voucherDetailVO.setFieldValue(ten);
                        voucherDetailVO.setMaxlength(vouFieldVO.getMaxlength());
                        voucherDetailVO.setIsnewline(vouFieldVO.getIsnewline());
                        listDe.add(voucherDetailVO);
                    }
                }
                if (vouFieldVO.getField().trim().equals("thousand")) {
                    if (!thousand.equals("") && !thousand.equals("-1")) {
                        x = Integer.parseInt(pos.split(",")[0]);
                        y = Integer.parseInt(pos.split(",")[1]);
                        x1 = Integer.parseInt(pos1.split(",")[0]);
                        VoucherDetailVO voucherDetailVO = new VoucherDetailVO();
                        voucherDetailVO.setVoVdSn(IdWorker.getOrderCode(busitype));
                        voucherDetailVO.setVoDeSn(VO_SN);
                        voucherDetailVO.setOrderbillsn(ORDERBILLSN);

                        Color color = Color.BLACK;
                        String cc = ImageUtils.Color2String(color);

                        voucherDetailVO.setAlpha(1);
                        voucherDetailVO.setFontcolor(cc);
                        voucherDetailVO.setFontname("宋体");

                        voucherDetailVO.setFontsize(40);
                        voucherDetailVO.setHalign(vouFieldVO.getHalign());
                        voucherDetailVO.setX(x);
                        voucherDetailVO.setY(y);
                        voucherDetailVO.setXx(x1);
                        voucherDetailVO.setYy(y);
                        voucherDetailVO.setField("thousand");
                        voucherDetailVO.setFieldType("String");
                        voucherDetailVO.setFieldValue(thousand);
                        voucherDetailVO.setMaxlength(vouFieldVO.getMaxlength());
                        voucherDetailVO.setIsnewline(vouFieldVO.getIsnewline());
                        listDe.add(voucherDetailVO);
                    }
                }
                if (vouFieldVO.getField().trim().equals("tmillion")) {
                    if (!tmillion.equals("") && !tmillion.equals("-1")) {
                        x = Integer.parseInt(pos.split(",")[0]);
                        y = Integer.parseInt(pos.split(",")[1]);
                        x1 = Integer.parseInt(pos1.split(",")[0]);
                        VoucherDetailVO voucherDetailVO = new VoucherDetailVO();
                        voucherDetailVO.setVoVdSn(IdWorker.getOrderCode(busitype));
                        voucherDetailVO.setVoDeSn(VO_SN);
                        voucherDetailVO.setOrderbillsn(ORDERBILLSN);

                        Color color = Color.BLACK;
                        String cc = ImageUtils.Color2String(color);

                        voucherDetailVO.setAlpha(1);
                        voucherDetailVO.setFontcolor(cc);
                        voucherDetailVO.setFontname("宋体");

                        voucherDetailVO.setFontsize(40);
                        voucherDetailVO.setHalign(vouFieldVO.getHalign());
                        voucherDetailVO.setX(x);
                        voucherDetailVO.setY(y);
                        voucherDetailVO.setXx(x1);
                        voucherDetailVO.setYy(y);
                        voucherDetailVO.setField("tmillion");
                        voucherDetailVO.setFieldType("String");
                        voucherDetailVO.setFieldValue(tmillion);
                        voucherDetailVO.setMaxlength(vouFieldVO.getMaxlength());
                        voucherDetailVO.setIsnewline(vouFieldVO.getIsnewline());
                        listDe.add(voucherDetailVO);
                    }
                }
                if (vouFieldVO.getField().trim().equals("tthousand")) {
                    if (!tthousand.equals("") && !tthousand.equals("-1")) {
                        x = Integer.parseInt(pos.split(",")[0]);
                        y = Integer.parseInt(pos.split(",")[1]);
                        x1 = Integer.parseInt(pos1.split(",")[0]);
                        VoucherDetailVO voucherDetailVO = new VoucherDetailVO();
                        voucherDetailVO.setVoVdSn(IdWorker.getOrderCode(busitype));
                        voucherDetailVO.setVoDeSn(VO_SN);
                        voucherDetailVO.setOrderbillsn(ORDERBILLSN);

                        Color color = Color.BLACK;
                        String cc = ImageUtils.Color2String(color);

                        voucherDetailVO.setAlpha(1);
                        voucherDetailVO.setFontcolor(cc);
                        voucherDetailVO.setFontname("宋体");

                        voucherDetailVO.setFontsize(40);
                        voucherDetailVO.setHalign(vouFieldVO.getHalign());
                        voucherDetailVO.setX(x);
                        voucherDetailVO.setY(y);
                        voucherDetailVO.setXx(x1);
                        voucherDetailVO.setYy(y);
                        voucherDetailVO.setField("tthousand");
                        voucherDetailVO.setFieldType("String");
                        voucherDetailVO.setFieldValue(tthousand);
                        voucherDetailVO.setMaxlength(vouFieldVO.getMaxlength());
                        voucherDetailVO.setIsnewline(vouFieldVO.getIsnewline());
                        listDe.add(voucherDetailVO);
                    }
                }
                if (vouFieldVO.getField().trim().equals("year")) {
                    String[] posId = pos.split("\\|");
                    x = Integer.parseInt(posId[0].split(",")[0]);
                    y = Integer.parseInt(posId[0].split(",")[1]);
                    String[] posId1 = pos1.split("\\|");
                    x1 = Integer.parseInt(posId1[0].split(",")[0]);

                    VoucherDetailVO voucherDetailVO = new VoucherDetailVO();
                    voucherDetailVO.setVoVdSn(IdWorker.getOrderCode(busitype));
                    voucherDetailVO.setVoDeSn(VO_SN);
                    voucherDetailVO.setOrderbillsn(ORDERBILLSN);

                    Color color = Color.BLACK;
                    String cc = ImageUtils.Color2String(color);

                    voucherDetailVO.setAlpha(1);
                    voucherDetailVO.setFontcolor(cc);
                    voucherDetailVO.setFontname("宋体");

                    voucherDetailVO.setFontsize(40);
                    voucherDetailVO.setHalign(vouFieldVO.getHalign());
                    voucherDetailVO.setX(x);
                    voucherDetailVO.setY(y);
                    voucherDetailVO.setXx(x1);
                    voucherDetailVO.setYy(y);
                    voucherDetailVO.setField("year");
                    voucherDetailVO.setFieldType("String");
                    voucherDetailVO.setFieldValue("");
                    voucherDetailVO.setMaxlength(vouFieldVO.getMaxlength());
                    voucherDetailVO.setIsnewline(vouFieldVO.getIsnewline());
                    listDe.add(voucherDetailVO);
                }
                if (vouFieldVO.getField().trim().equals("yuan")) {
                    if (!yuan.equals("") && !yuan.equals("-1")) {
                        x = Integer.parseInt(pos.split(",")[0]);
                        y = Integer.parseInt(pos.split(",")[1]);
                        x1 = Integer.parseInt(pos1.split(",")[0]);
                        VoucherDetailVO voucherDetailVO = new VoucherDetailVO();
                        voucherDetailVO.setVoVdSn(IdWorker.getOrderCode(busitype));
                        voucherDetailVO.setVoDeSn(VO_SN);
                        voucherDetailVO.setOrderbillsn(ORDERBILLSN);

                        Color color = Color.BLACK;
                        String cc = ImageUtils.Color2String(color);

                        voucherDetailVO.setAlpha(1);
                        voucherDetailVO.setFontcolor(cc);
                        voucherDetailVO.setFontname("宋体");

                        voucherDetailVO.setFontsize(40);
                        voucherDetailVO.setHalign(vouFieldVO.getHalign());
                        voucherDetailVO.setX(x);
                        voucherDetailVO.setY(y);
                        voucherDetailVO.setXx(x1);
                        voucherDetailVO.setYy(y);
                        voucherDetailVO.setField("yuan");
                        voucherDetailVO.setFieldType("String");
                        voucherDetailVO.setFieldValue(yuan);
                        voucherDetailVO.setMaxlength(vouFieldVO.getMaxlength());
                        voucherDetailVO.setIsnewline(vouFieldVO.getIsnewline());
                        listDe.add(voucherDetailVO);
                    }
                }
            }
        }
        return listDe;
    }
}
